<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!doctype html>
<html lang="en">
<head>
	<title>文章列表</title>
	<meta charset='utf-8'/>
	<script type="text/javascript" src="http://localhost/myweb/Static/hdjs/jquery-1.8.2.min.js"></script>
    <link rel="stylesheet" href="http://localhost/myweb/Static/hdjs/hdjs.css"/>
    <script type="text/javascript" src="http://localhost/myweb/Static/hdjs/hdjs.min.js"></script>
	<script type="text/javascript" src="http://localhost/myweb/App/Tcadmin/View/Article/js/content.js"></script>
	<script type='text/javascript'>
HOST = 'http://localhost';
ROOT = 'http://localhost/myweb';
WEB = 'http://localhost/myweb/index.php';
URL = 'http://localhost/myweb/index.php/Tcadmin/Article/index';
APP = 'http://localhost/myweb/App';
COMMON = 'http://localhost/myweb/App/Common';
HDPHP = 'http://localhost/myweb/Core';
HDPHP_DATA = 'http://localhost/myweb/Core/Data';
HDPHP_EXTEND = 'http://localhost/myweb/Core/Extend';
MODULE = 'http://localhost/myweb/index.php/Tcadmin';
CONTROLLER = 'http://localhost/myweb/index.php/Tcadmin/Article';
ACTION = 'http://localhost/myweb/index.php/Tcadmin/Article/index';
STATIC = 'http://localhost/myweb/Static';
HDPHP_TPL = 'http://localhost/myweb/Core/Lib/Tpl';
VIEW = 'http://localhost/myweb/App/Tcadmin/View';
PUBLIC = 'http://localhost/myweb/App/Tcadmin/View/Public';
CONTROLLER_VIEW = 'http://localhost/myweb/App/Tcadmin/View/Article';
HISTORY = 'http://localhost/myweb/index.php/Tcadmin/Index/index';
</script>
</head>
<body>
<div class="hd-menu-list">
	<ul>
		 <li class="active"><a href="<?php echo U('index',array('cid' =>1));?>" > 新闻中心 </a></li>
		 <li class="active"><a href="<?php echo U('index',array('cid' =>2));?>"> 产品中心 </a></li>
	</ul>
</div>
<div>
	<table class='hd-table hd-table-list'>
		<thead>
			<tr>
				<td class="hd-w30"><input type="checkbox" id="select_all"/></td>
				<td class='hd-w30'>ID</td>
				<td class='hd-w50'>栏目</td>
				<td>标题</td>
				<td class='hd-w100'>作者</td>
				<td class='hd-w50'>点击数</td>
				<td class='hd-w100'>操作</td>
			</tr>
		</thead>
		        <?php
        //初始化
        $hd['list']['a'] = array(
            'first' => false,
            'last'  => false,
            'total' => 0,
            'index' => 0
        );
        if (empty($article)) {
            echo '';
        } else {
            $listId = 0;
            $listShowNum=0;
            $listNextId=0;
            foreach ($article as $a) {
                //开始值
                if ($listId<0) {
                    $listId++;
                    continue;
                }
                //步长
                if($listId!=$listNextId){$listId++;continue;}
                //显示条数
                if($listShowNum>=100)break;
                //第几个值
                $hd['list'][a]['index']++;
                //第1个值
                $hd['list'][a]['first']=($listId == 0);
                //最后一个值
                $hd['list'][a]['last']= (count($article)-1 <= $listId);
                //总数
                $hd['list'][a]['total']++;
                //增加数
                $listId++;
                $listShowNum++;
                $listNextId+=1
                ?>
		<tr>
				<td><input type="checkbox" name="id[]" value="<?php echo $a['id'];?>"/></td>
				<td><?php echo $a['id'];?></td>
				<td><?php echo $a['cname'];?></td>
				<td><?php echo $a['title'];?></td>
				<td><?php echo $a['author'];?></td>
				<td><?php echo $a['click'];?></td>
				<td>
					<a href="<?php echo U('Index/Index/show',array('id'=>$a['id']));?>"  target="_blank" >查看</a> |
					<a href="<?php echo U(edit,array('id'=>$a['id']));?>">编辑</a> |
					<a href="<?php echo U(del,array('id'=>$a['id']));?>">删除</a>
				</td>
			</tr>
		<?php }}?>
	</table>
	<div class="hd-page">
	<?php echo $page;?>
	</div>
</div>
<div style="margin:20px 10pc;">
	<input type="button" class="hd-cancel" value="全选" onclick="select_all('.table2')"/>
	<input type="button" class="hd-cancel" value="反选" onclick="reverse_select('.table2')"/>
	<input type="button" class="hd-cancel" onclick="del()" value="批量删除"/>
</div>
</body>
</html>
